<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Title</title>
    <style>
        .item{
            margin-top: 5px;
            background-color: orange;
        }
        .item .title{
            color: red;
        }
    </style>
</head>
<body>
<div id="app">
<h2>电影列表</h2>
<ul>
    <li v-for="item in movies">
        {{item}}
    </li>
</ul>

    <ul>
        <li v-for="(movie,index) in movies">
            {{index+1}}->{{movie}}
        </li>
    </ul>

    <h2>商品列表</h2>
    <ul>
        <li v-for="item in products">
            <div class="title">商品：{{item.name}}</div>
            <span>价格：{{item.price}}</span>
            <p>秒杀：{{item.desc}}</p>
        </li>
    </ul>
</div>

<script src="https://unpkg.com/vue@3"></script>
<script>
    const app=Vue.createApp({
        data(){
            return{
                movies:["星际穿越","少年派","大话西游","多啦av梦"],
                products: [
                    { id: 110, name: "Macbook", price: 9.9, desc: "9.9秒杀, 快来抢购!" },
                    { id: 111, name: "iPhone", price: 8.8, desc: "9.9秒杀, 快来抢购!" },
                    { id: 112, name: "小米电脑", price: 9.9, desc: "9.9秒杀, 快来抢购!" },
                ]
            }
        },
        methods:{

        }
    })
    app.mount("#app")
</script>
</body>
</html>